Ext.define('Tg.tx.Echarts', {
    extend: 'Ext.panel.Panel',
    xtype:'echarts', //xtype定义好
    border: false,
	height:200,
	width:'100%',
    config: {
        option: {
            tooltip: {},
            legend: {
                data:['数据']
            },
            xAxis: {
                data: ["分类"]
            },
            yAxis: {},
            series: [{
                name: '数据',
                type: 'bar',
                data: [0]
            }]
        }
    },
    initComponent: function(){
        var me = this;
        if(!me.height){
            throw new Error("图表组件要高度");
        }
		console.log(me.option);
        me.on("boxready", function () {
            me.echarts = echarts.init(me.getEl().dom);
            if (me.option) {
                me.echarts.setOption(me.option);
            }
        });
        me.callParent();
    }
});